﻿namespace NTLib.Core.Collection.Tree
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;

    /// <summary>
    /// Define an object able to sequence the <typeparamref name="TSource"/> into <typeparamref name="TSeq"/> Elements and revert.
    /// </summary>
    /// <typeparam name="TSource">The type of the souce.</typeparam>
    /// <typeparam name="TSeq">The type of the sequence elements.</typeparam>
    public interface ISenquensor<TSource, TSeq>
    {
        #region Methods

        /// <summary>
        /// Senquences the specified element into <typeparamref name="TSeq"/> parts.
        /// </summary>
        /// <param name="element">The element.</param>
        /// <returns></returns>
        TSeq[] Senquence(TSource element);

        /// <summary>
        /// Constructs the specified element from the <typeparamref name="TSeq"/> parts.
        /// </summary>
        /// <param name="elementParts">The element parts.</param>
        /// <returns></returns>
        TSource Construct(IEnumerable<TSeq> elementParts);

        #endregion
    }
}
